/**
 * ClueConversionType枚举
 *
 * @author sxf
 * @email sxf02615@163.com
 * @date 2025/1/15
 */
package com.sxf.crm.enums;


/**
 * 线索转化类型枚举
 * 
 * <p>定义线索可以转化的类型：客户和商机</p>
 * 
 * @author sxf
 * @email sxf02615@163.com
 * @date 2025/6/1
 */
public enum ClueConversionType {
    /**
     * 转化为客户
     */
    CUSTOMER("CUSTOMER", "转化为客户"),

    /**
     * 转化为商机
     */
    OPPORTUNITY("OPPORTUNITY", "转化为商机");

    private final String code;
    private final String description;

    ClueConversionType(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    /**
     * 根据code获取枚举值
     *
     * @param code 枚举code
     * @return 对应的枚举值，如果不存在返回null
     */
    public static ClueConversionType getByCode(String code) {
        for (ClueConversionType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }

} 